const babel = require('@babel/core')
const myPlug = {
  visitor: {
    FunctionDeclaration() {
      console.log('深度优先搜索进入1111!')
    },
  },
}
const preCode = `
    function square(n) {
        return n * n;
    }
`
const babelCfg = {
  plugins: [myPlug],
}
const { code } = babel.transformSync(preCode, babelCfg)
console.log(code)
